﻿@model Label
@{
    var templateId = Kooboo.UniqueIdGenerator.GetInstance().GetBase32UniqueId(10);
    var displayTemplateId = templateId + "_display";
    var editorTemplateId = templateId + "_editor";
}
<div id="@displayTemplateId" class="display-template">
    <span class="text">@Model.Value</span>
    <a data-tr-hover="true" data-inline-action='{"show":"#@editorTemplateId","hide":"#@displayTemplateId"}' class="action left hide">@Html.IconImage("edit small")</a>
</div>

<div id="@editorTemplateId" class="edit-template hide">
    @using (Html.BeginForm(ViewContext.RequestContext.AllRouteValues().Merge("UUID",Model.UUID).Merge("Category", Model.Category).Merge("Name", Model.Name).Merge("Action", "Edit").Merge("return", Request.RawUrl)))
    {
        <textarea name="Value" class="editor">@Model.Value</textarea>
        <a class="action" data-ajaxform="">@Html.IconImage("save small")</a>
        <a class="action" data-inline-action='{"show":"#@displayTemplateId","hide":"#@editorTemplateId"}'>@Html.IconImage("minus small")</a>
    }
</div>
